package com.party.core.dao.read.crowdfund;

import com.party.core.dao.read.BaseReadDao;
import com.party.core.model.crowdfund.EventGradation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName CrowdfundEventGradationReadDao
 * @Description 主题阶段信息读取
 * @Author yifeng
 * @Date 2019/3/20 9:29
 **/
public interface EventGradationReadDao extends BaseReadDao<EventGradation> {

    /**
     * @Description: 获取正在进行的阶段主题
     * @Param:  eventId
     * @return: EventGradation
     * @Author: Hua Qunhao
     * @Date: 2019-03-21-0021
     */
    EventGradation findOngoingGradation(String eventId);


    /***
     * 根据projectId 找到当前众筹者正在众筹哪个阶段
     * @param projectId
     * @return
     */
    EventGradation getOngoingGradation(String projectId);


    List<EventGradation> withCityNameByEventId(@Param(value = "eventId") String eventId);

    /**
    * @Description:  获取阶段众筹主题金额
    * @Param: eventGradation，sign（0：众筹结束阶段/1：报名阶段和未开始的阶段）
    * @return:
    * @Author: Hua Qunhao
    * @Date: 2019-03-22-0022
    */
    Double getGradationTotalAmount(@Param(value = "eventGradation")EventGradation eventGradation,@Param(value = "sign")Integer sign);


    /**
     * @Description:  获取阶段众筹主题列表
     * @Param: eventGradation，sign（0：众筹结束阶段/1：正在进行的和未开始的阶段）
     * @return:
     * @Author: Hua Qunhao
     * @Date: 2019-03-22-0022
     */
    List<EventGradation> getGradationList(@Param(value = "eventGradation")EventGradation eventGradation,@Param(value = "sign")Integer sign);

    /**
     * @param eventGradation
     * @return com.party.core.model.crowdfund.EventGradation
     * @Author yifeng
     * @Description 获取下个阶段
     * @Date 17:48 2019/3/22
     **/
    List<EventGradation> getNextGradations(EventGradation eventGradation);
    /***
     * 根据阶段数找到阶段主题
     * @param eventGradation
     * @return
     */
    EventGradation getTheNextGradation(@Param("eventGradation") EventGradation eventGradation);

    /***
     * 根据当前阶段获取之后的所有阶段
     * @param eventGradation
     * @return
     */
    List<EventGradation> getAfterEventGradations(@Param("eventGradation") EventGradation eventGradation);

    /**
    * @Description: 获取主题的最后的阶段
    * @Param:  eventId
    * @return: EventGradation
    * @Author: Hua Qunhao
    * @Date: 2019-03-27-0027
    */
    EventGradation getTheLastGradation(String eventId);
}
